package com.mano233.server.service.serviceImpl;

import com.mano233.server.mapper.UserMapperCustom;
import com.mano233.server.po.FormUserEditor;
import com.mano233.server.po.User;
import com.mano233.server.service.UserService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    private final UserMapperCustom userMapperCustom;

    public UserServiceImpl(UserMapperCustom userMapperCustom) {
        this.userMapperCustom = userMapperCustom;
    }

    @Override
    public void updateProfile(User user, int uid) {
    }

    @Override
    public List<FormUserEditor> getUserFormEditorList(int uid) {
        return userMapperCustom.getUserFormList(uid);
    }

    @Override
    @Transactional(timeout = 2)
    public List<User> searchUser(String userName) {
        return userMapperCustom.searchUser(userName);
    }
}
